<?php
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('article-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'article-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'class'=>'CCheckBoxColumn',
		    'id'=>'ids',
			'selectableRows'=>2, 
			//'name'=>'adminhtml-node-grid-ids',
		),
		array(
			'name'=> 'article_id',
			'htmlOptions'=>array('style'=>'width:50px'),
		),
		//'cat.cat_name',
		array(
            'name'=>'cat_id',
            'value'=>'$data->cat->cat_name',
        ),
		array(
            'name'=> 'title',
			'type'=>'html',
            'value'=>'CHtml::link($data->title, Yii::app()->createAbsoluteUrl("cms/article/detail/id/". $data->article_id ), array("target"=>"_blank") )',
        	'htmlOptions'=>array('style'=>'width:250px;padding-left:10px;' ),
		),
		'create_time',
		'sort_order',
		array(
	        'name' => 'status',
	        'type' => 'raw',
	        'htmlOptions'=>array('style'=>'width:30px'),
			'value' => 'AdminhtmlHelper::getStatusLabel( $data->status )',
			'filter'=> AdminhtmlHelper::getStatusOptions(),
	    ),
	    /*
		 'author',
		 'content',
		 */
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
